
import { https } from '@/utils/http.js'

// show_loading 是否显示加载中 默认为true
// duplicate_submit 是否限制重复请求（1秒内如果多个请求都为true，只有一个请求会成功，其余失败）
// duplicate_submit 默认为false

// export const api = {
//     // 登录
//     login: {
//         url: 'api.login/login',
//         method: 'POST'
//     },
//     // 注册
//     register: {
//         url: 'api.login/register',
//         duplicate_submit: true,
//         method: 'POST'
//     },
//     // 协议
//     agreement: {
//         url: 'index.agreement/detail',
//         method: 'GET'
//     },
// }

//支付页面，小程序登录
export const payLogin = (params, show_loading = true) => {
    return https({ url: 'index.mini/login', method: 'POST', show_loading: show_loading }, params)
}
//支付页面，获取商家信息
export const payShopInfo = (params, show_loading = true) => {
    return https({ url: 'index.pay/shopInfo', method: 'GET', show_loading: show_loading }, params)
}
//支付页面，创建支付订单
export const payOrder = (params, show_loading = true) => {
    return https({ url: 'index.pay/order', method: 'POST', show_loading: show_loading }, params)
}
//支付宝h5登录
export const aliH5Login = (params, show_loading = true) => {
    return https({ url: 'index.h5/aliLogin', method: 'POST', show_loading: show_loading }, params)
}
//商家登录
export const businessLogin = (params, show_loading = true) => {
    return https({ url: 'api.login/login', method: 'POST', show_loading: show_loading }, params)
}

//用户信息
export const userInfo = (params, show_loading = true) => {
    return https({ url: 'index.user/info', method: 'GET', show_loading: show_loading }, params)
}

//收益记录
export const incomeList = (params, show_loading = true) => {
    return https({ url: 'index.user/incomeList', method: 'GET', show_loading: show_loading }, params)
}
//我的团队列表（带分页）
export const userList = (params, show_loading = true) => {
    return https({ url: 'index.user/index', method: 'POST', show_loading: show_loading }, params)
}
//我的钱包列表（带分页）
export const userWithdrawal = (params, show_loading = true) => {
    return https({ url: 'index.userWithdrawal/index', method: 'POST', show_loading: show_loading }, params)
}
//申请提现
export const addUserWithdrawal = (params, show_loading = true) => {
    return https({ url: 'index.userWithdrawal/addUserWithdrawal', method: 'POST', show_loading: show_loading }, params)
}
//收益明细列表（带分页）
export const incomeIndex = (params, show_loading = true) => {
    return https({ url: 'index.payOrders/incomeIndex', method: 'POST', show_loading: show_loading }, params)
}
//系统设置查询
export const systemConfig = (params, show_loading = true) => {
    return https({ url: 'index.systemConfig/index', method: 'POST', show_loading: show_loading }, params)
}

//获取商家广告
export const shopAd = (params, show_loading = true) => {
    return https({ url: 'index.ad/detail', method: 'GET', show_loading: show_loading }, params)
}

//扫码绑定上下级
export const scanBind = (params, show_loading = true) => {
    return https({ url: 'index.mini/bind', method: 'POST', show_loading: show_loading }, params)
}